import Vue from 'vue'
import VueRouter from 'vue-router'
import App from '../App'
import Home from '../views/Home.vue'
import About from '../views/About'
import MyMenu from '../views/MyMenu'
import PageOne from '../views/test/PageOne'
import PageTwo from '../views/test/PageTwo'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: '学生管理',
        component: MyMenu,
        redirect:"/pageone",
        children:[
            {
                path: '/pageone',
                name: '学生列表',
                component:PageOne
            },
            {
                path: '/test/pagetwo',
                name: '添加学生',
                component:PageTwo
            }
        ]
    },
    {
        path: '/navigation2',
        name: '导航2',
        component: MyMenu,
        children:[
            {
                path: '/home',
                name: 'home',
                component: Home
            },
            {
                path: '/about',
                name: 'about',
                component: About
            }
        ]
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
